﻿using System;

/* 写一个方法生成一个随机长度(20~30)数组，用0~100的随机数填充该数组 */
namespace Practice6
{
    public class Practice
    {
        static int[] GetRandomArrat()
        {
            Random r = new Random();
            int len = r.Next(20, 31);
            int[] array = new int[len];

            for (int i = 0; i < len; i++)
            {
                array[i] = r.Next(0, 101);
            }

            return array;
        }

        public static void Execute()
        {
            Console.Write("获取随机数组:");
            int[] array = GetRandomArrat();
            string str = string.Join(" ", array);
            Console.WriteLine($"{str} | 长度: {array.Length}");
        }
    }
}